package com.drakeet.multitype.sample.comment.adapter

import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.drakeet.multitype.ItemViewBinder
import com.drakeet.multitype.sample.R
import com.drakeet.multitype.sample.comment.model.LoadMore

/**
 * Created by TracyEminem on 2019/7/12 下午10:39.
 */
class LoadMoreAdapter : ItemViewBinder<LoadMore, LoadMoreAdapter.ViewHolder>() {

    public interface onLoadMore {
        fun onLoadMore(position: Int)
    }

    lateinit var onLoadMoreInterface: onLoadMore


    override fun onBindViewHolder(holder: ViewHolder, item: LoadMore) {
        holder.itemView.setOnClickListener {
            if (onLoadMoreInterface != null) {
                onLoadMoreInterface.onLoadMore(holder.adapterPosition)
            }
        }
    }

    override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): ViewHolder {
        return ViewHolder(inflater.inflate(R.layout.item_comment_loadmore, parent, false))
    }


    open class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

    }

}